package com.cx.Interceptor;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @ClassName: MyInterceptor
 * @Description:
 * @Author: cx
 * @Date: 2022/10/23 10:21
 **/
public class MyInterceptor implements HandlerInterceptor {
    /*这个接口里面一共有三个方法，分别是拦截前，拦截中和拦截后,返回布尔类型，返回true放行返回false不放行*/
    /*场景应用可以做一些cookie和session的认证*/
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        System.out.println("拦截之前");
        return false;
    }
}
